<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019-06-13
  Time: 15:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String pash = request.getContextPath();
    String basepash = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + pash + "/";
%>
<html>
<head>
    <base href="<%=basepash%>">
    <%@include file="/publs.jsp"%>
    <title>医药管理</title>
    <link rel="shortcuticon" href="static/images/1.png" type="image/x-icon"/>
    <link rel="stylesheet" href="static/css/font.css">
    <link rel="stylesheet" href="static/css/xadmin.css">
    <link class="yangShi" rel="stylesheet" type="text/css" href=""/>
    <script src="static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="static/js/xadmin.js"></script>
    <script type="text/javascript" src="static/js/jquery-1.11.0.js"></script>
</head>
<body class="index">
<!-- 顶部开始 -->
<div class="container">
    <div class="logo">
        <a href="javascript:void(0);">医药管理</a></div>
    <div class="left_open">
        <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
    </div>
    <ul class="layui-nav left fast-add" lay-filter="">
        <li class="layui-nav-item">
            <a href="javascript:;">主题</a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                <dd>
                    <button class="zhuTi" name="static/css/theme10.min.css" style="margin-left: 10px;margin-right:10px;border: none;background-color: white">黑白简约风</button>
                <dd>
                <dd>
                    <button class="zhuTi" name="static/css/theme49.min.css" style="margin-left: 10px;margin-right:10px;border: none;background-color: white">等你说明天</button>
                <dd>
                <dd>
                    <button class="zhuTi" name="static/css/theme12.min.css" style="margin-left: 10px;margin-right:10px;border: none;background-color: white">黑绿蓝白</button>
                <dd>
                <dd>
                    <button class="zhuTi" name="static/css/theme413.min.css" style="margin-left: 10px;margin-right:10px;border: none;background-color: white">渐变色</button>
                <dd>
                <dd>
                    <button class="zhuTi" name="static/css/theme183.min.css" style="margin-left: 10px;margin-right:10px;border: none;background-color: white">火红色</button>
                <dd>

            </dl>
        </li>
    </ul>
    <ul class="layui-nav right" lay-filter="" >
        <li class="layui-nav-item" style="margin-right: 40px">
            <a href="javascript:;">${admin.account}</a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                <dd>
                    <a onclick="xadmin.open('个人信息','/users/user')">个人信息</a></dd>
                <dd>
                    <a href="/logout">退出</a></dd>
            </dl>
        </li>
    </ul>
</div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div class="left-nav">
    <div id="side-nav">
        <ul id="nav">
            <c:forEach items="${menus}" var="a">
                <li>
                    <a href="javascript:;">
                        <i class="iconfont left-nav-li"  lay-tips="${a.name}">${a.icons}</i>
                        <cite>${a.name}</cite>
                        <%--&#xe6b4;--%>
                        <i class="iconfont nav_right">&#xe697;</i></a>
                    <ul class="sub-menu">
                        <c:forEach items="${a.asa}" var="b">
                            <li>
                                <a onclick="xadmin.add_tab('${b.names}','${b.urls}')" id="shuaxinshijian" target="">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>${b.names}</cite></a>
                            </li>
                        </c:forEach>
                    </ul>
                </li>
            </c:forEach>
        </ul>
    </div>
</div>
<!-- <div class="x-slide_left"></div> -->
<!-- 左侧菜单结束 -->
<!-- 右侧主体开始 -->
<div class="page-content">
    <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
        <ul class="layui-tab-title">
            <li class="home">
                <i class="layui-icon">&#xe68e;</i>我的桌面</li></ul>
        <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
            <dl>
                <dd data-type="this">关闭当前</dd>
                <dd data-type="other">关闭其它</dd>
                <dd data-type="all">关闭全部</dd></dl>
        </div>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src="indesx" name="namesadmin" frameborder="0" scrolling="yes" class="x-iframe"></iframe>
            </div>
        </div>
    </div>
</div>
<!-- 右侧主体结束 -->
<!-- 中部结束 -->
<div id="root">
    <Modal width="80%" :closable="false"  :mask-closable="false" v-model="asd" title="库存数量预警" @onOk="sdasdada" okText="关闭">
        <i-table  height="350px" style="margin-top:20px;margin-right: 50px;margin-left: 50px;" :data="datas" :columns="colunmsss" border>

        </i-table>
    </Modal>
</div>
</body>
<script>
    new Vue({
      el:"#root",
      data:{
          asd:false,
          datas:[],
          time:3600,
          asdasd:0,
          asdasdsss:0,
          colunmsss:[
              {title:"编号", key:"drugsid", sortable:true},
              {title:"药品名称", key:"drugsName"},
              {title:"所在仓库", key:"wname"},
              {title:"剩余数量", key:"number",tooltip:true}
          ]
      },

        methods:{
            info (aaa) {
                this.$Notice.info({
                    title: '药品过期提醒!',
                    desc: false ? '' : "过期商品，请进行处理"
                });
            },
            search(){
                let zhi = setInterval(function () {
                    _this.time--;
                    // console.log( _this.time)
                    if(_this.time==0){
                        _this.time = 3600;
                    }
                    axios.get("/jishiqi").then(({data})=> {
                        console.log(data.msg)
                        if (data.msg != null) {
                            _this.info(data.msg);
                            clearTimeout(zhi);
                        }
                    })
                },1000);

                // axios.get("/jishiqi").then(({data})=>{
                //     if(data.msg!=null){
                //         this.info(data.msg);
                //     }
                    // iview.Message.warning(data.msg);
            },
            searchshuliang(){
                let zhi = setInterval(function () {
                    _this.time--;
                    // console.log( _this.time)
                    if(_this.time==0){
                        _this.time = 3600;
                    }
                    axios.get("/kucunyujing").then(({data})=>{
                        // console.log(data.obj)
                        _this.datas=data.obj;
                        if(_this.datas.length>0){
                            _this.asd = true;
                        }else{
                            _this.asd = false;
                        }
                        clearTimeout(zhi);
                    })
                },1000);


            },
            // dingshiqi(){
            //     setInterval(function () {
            //         _this.time--;
            //         // console.log( _this.time)
            //         if(_this.time==0){
            //             _this.time = 3600;
            //         }
            //         _this.searchshuliang();
            //         _this.search();
            //     },1000);
            // },
            sdasdada(){
                this.asd=false;
            }
            // ,dingsshiqi(){
            //     setInterval(function () {
            //         this.search();
            //     },10)
            // }
        },
        mounted(){
          // this.dingshiqi();
          // this.searchshuliang();
          //   this.search();
            // this.dingsshiqi();


            //  _this.searchshuliang();
            // _this.search();
        },
        created(){
            _this = this;
        }
    })
</script>
<script>

    $(function () {
        $(".layui-tab-title").click(function () {
            // location.reload();
            // console.log(this)
        })
        $('.yangShi').attr('href','static/css/theme10.min.css');
        $(".zhuTi").click(function () {
            var zhi = $(this).attr("name");
            $('.yangShi').attr('href',zhi);
            window.range();
        })
    })
</script>
</html>
